package com.qutan.app.core.domain.enumclass;

/**
 * Created by oyhk on 15-4-17.
 * 是否第三方登录枚举
 */
public enum ThreeLogin {
    NORMAL("非第三方", 0), WINXIN("微信", 1), QQ("QQ", 2), WEIBO("微博", 3);

    ThreeLogin(String text, int sort) {
        this.text = text;
        this.sort = sort;
    }

    private int sort;
    private String text;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }


    public static ThreeLogin getThreeLoginByFlag(int flag){
        if(flag==ThreeLogin.NORMAL.getSort()){
            return ThreeLogin.NORMAL;
        }else if(flag==ThreeLogin.WINXIN.getSort()){
            return ThreeLogin.WINXIN;
        }else if(flag==ThreeLogin.QQ.getSort()){
            return ThreeLogin.QQ;
        }else if(flag==ThreeLogin.WEIBO.getSort()){
            return ThreeLogin.WEIBO;
        }else{
            return null;
        }
    }
}
